#include <stdlib.h>
#include <stdio.h>
#include <string.h>

#define MAX_COMMANDLINE_SIZE 512
#define DELIMITERS " \t"

int main(int argc, char *argv[]){
	char *s = NULL;
	char *myargv[MAX_COMMANDLINE_SIZE];
	int i = 0;

	s = malloc(512 * sizeof(char));
	
	/*myargv = malloc(MAX_COMMANDLINE_SIZE * sizeof(char));*/

	if(myargv == NULL) { exit(1); }
	strcpy(s, "Hello	 Token World");

	i = 0;
	myargv[i++] = strtok(s, DELIMITERS);
	while( (myargv[i++] = strtok(NULL, DELIMITERS)) != NULL);
	
	i = 0;
	while(myargv[i] != NULL){
		printf("myargv[%d]: \"%s\"\n", i, myargv[i]);
		i++;
	}

	
	return EXIT_SUCCESS;
}


